home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / info / lispref.info-33.z / lispref.info-33
Encoding:
GNU Info File  |  1998-05-21  |  50.3 KB  |  1,118 lines

  1. This is Info file ../../info/lispref.info, produced by Makeinfo version
  2. 1.68 from the input file lispref.texi.
  3.  
  4.    Edition History:
  5.  
  6.    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
  7. Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
  8. Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
  9. XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
  10. GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
  11. Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp
  12. Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp
  13. Reference Manual (for 19.15 and 20.1, 20.2) v3.2, April, May 1997
  14.  
  15.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
  16. Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
  17. Copyright (C) 1995, 1996 Ben Wing.
  18.  
  19.    Permission is granted to make and distribute verbatim copies of this
  20. manual provided the copyright notice and this permission notice are
  21. preserved on all copies.
  22.  
  23.    Permission is granted to copy and distribute modified versions of
  24. this manual under the conditions for verbatim copying, provided that the
  25. entire resulting derived work is distributed under the terms of a
  26. permission notice identical to this one.
  27.  
  28.    Permission is granted to copy and distribute translations of this
  29. manual into another language, under the above conditions for modified
  30. versions, except that this permission notice may be stated in a
  31. translation approved by the Foundation.
  32.  
  33.    Permission is granted to copy and distribute modified versions of
  34. this manual under the conditions for verbatim copying, provided also
  35. that the section entitled "GNU General Public License" is included
  36. exactly as in the original, and provided that the entire resulting
  37. derived work is distributed under the terms of a permission notice
  38. identical to this one.
  39.  
  40.    Permission is granted to copy and distribute translations of this
  41. manual into another language, under the above conditions for modified
  42. versions, except that the section entitled "GNU General Public License"
  43. may be included in a translation approved by the Free Software
  44. Foundation instead of in the original English.
  45.  
  46. 
  47. File: lispref.info,  Node: Adding Specifications,  Next: Retrieving Specifications,  Prev: Specifier Types,  Up: Specifiers
  48.  
  49. Adding specifications to a Specifier
  50. ====================================
  51.  
  52.  - Function: add-spec-to-specifier SPECIFIER INSTANTIATOR &optional
  53.           LOCALE TAG-SET HOW-TO-ADD
  54.      This function adds a specification to SPECIFIER.  The
  55.      specification maps from LOCALE (which should be a buffer, window,
  56.      frame, device, or the symbol `global', and defaults to `global')
  57.      to INSTANTIATOR, whose allowed values depend on the type of the
  58.      specifier.  Optional argument TAG-SET limits the instantiator to
  59.      apply only to the specified tag set, which should be a list of
  60.      tags all of which must match the device being instantiated over
  61.      (tags are a device type, a device class, or tags defined with
  62.      `define-specifier-tag').  Specifying a single symbol for TAG-SET
  63.      is equivalent to specifying a one-element list containing that
  64.      symbol.  Optional argument HOW-TO-ADD specifies what to do if
  65.      there are already specifications in the specifier.  It should be
  66.      one of
  67.  
  68.     `prepend'
  69.           Put at the beginning of the current list of instantiators for
  70.           LOCALE.
  71.  
  72.     `append'
  73.           Add to the end of the current list of instantiators for
  74.           LOCALE.
  75.  
  76.     `remove-tag-set-prepend'
  77.           This is the default.  Remove any existing instantiators whose
  78.           tag set is the same as TAG-SET; then put the new instantiator
  79.           at the beginning of the current list.
  80.  
  81.     `remove-tag-set-append'
  82.           Remove any existing instantiators whose tag set is the same as
  83.           TAG-SET; then put the new instantiator at the end of the
  84.           current list.
  85.  
  86.     `remove-locale'
  87.           Remove all previous instantiators for this locale before
  88.           adding the new spec.
  89.  
  90.     `remove-locale-type'
  91.           Remove all specifications for all locales of the same type as
  92.           LOCALE (this includes LOCALE itself) before adding the new
  93.           spec.
  94.  
  95.     `remove-all'
  96.           Remove all specifications from the specifier before adding
  97.           the new spec.
  98.  
  99.      `remove-tag-set-prepend' is the default.
  100.  
  101.      You can retrieve the specifications for a particular locale or
  102.      locale type with the function `specifier-spec-list' or
  103.      `specifier-specs'.
  104.  
  105.  - Function: add-spec-list-to-specifier SPECIFIER SPEC-LIST &optional
  106.           HOW-TO-ADD
  107.      This function adds a "spec-list" (a list of specifications) to
  108.      SPECIFIER.  The format of a spec-list is
  109.  
  110.             `((LOCALE (TAG-SET . INSTANTIATOR) ...) ...)'
  111.  
  112.      where
  113.  
  114.         * LOCALE := a buffer, a window, a frame, a device, or `global'
  115.  
  116.         * TAG-SET := an unordered list of zero or more TAGS, each of
  117.           which is a symbol
  118.  
  119.         * TAG := a device class (*note Consoles and Devices::.), a
  120.           device type, or a tag defined with `define-specifier-tag'
  121.  
  122.         * INSTANTIATOR := format determined by the type of specifier
  123.  
  124.      The pair `(TAG-SET . INSTANTIATOR)' is called an "inst-pair".  A
  125.      list of inst-pairs is called an "inst-list".  The pair `(LOCALE .
  126.      INST-LIST)' is called a "specification".  A spec-list, then, can
  127.      be viewed as a list of specifications.
  128.  
  129.      HOW-TO-ADD specifies how to combine the new specifications with
  130.      the existing ones, and has the same semantics as for
  131.      `add-spec-to-specifier'.
  132.  
  133.      In many circumstances, the higher-level function `set-specifier' is
  134.      more convenient and should be used instead.
  135.  
  136.  - Function: set-specifier SPECIFIER VALUE &optional HOW-TO-ADD
  137.      This function adds some specifications to SPECIFIER.  VALUE can be
  138.      a single instantiator or tagged instantiator (added as a global
  139.      specification), a list of tagged and/or untagged instantiators
  140.      (added as a global specification), a cons of a locale and
  141.      instantiator or locale and instantiator list, a list of such
  142.      conses, or nearly any other reasonable form.  More specifically,
  143.      VALUE can be anything accepted by `canonicalize-spec-list'.
  144.  
  145.      HOW-TO-ADD is the same as in `add-spec-to-specifier'.
  146.  
  147.      Note that `set-specifier' is exactly complementary to
  148.      `specifier-specs' except in the case where SPECIFIER has no specs
  149.      at all in it but `nil' is a valid instantiator (in that case,
  150.      `specifier-specs' will return `nil' (meaning no specs) and
  151.      `set-specifier' will interpret the `nil' as meaning "I'm adding a
  152.      global instantiator and its value is `nil'"), or in strange cases
  153.      where there is an ambiguity between a spec-list and an inst-list,
  154.      etc. (The built-in specifier types are designed in such a way as
  155.      to avoid any such ambiguities.)
  156.  
  157.      If you want to work with spec-lists, you should probably not use
  158.      these functions, but should use the lower-level functions
  159.      `specifier-spec-list' and `add-spec-list-to-specifier'.  These
  160.      functions always work with fully-qualified spec-lists; thus, there
  161.      is no ambiguity.
  162.  
  163.  - Function: canonicalize-inst-pair INST-PAIR SPECIFIER-TYPE &optional
  164.           NOERROR
  165.      This function canonicalizes the given INST-PAIR.
  166.  
  167.      SPECIFIER-TYPE specifies the type of specifier that this SPEC-LIST
  168.      will be used for.
  169.  
  170.      Canonicalizing means converting to the full form for an inst-pair,
  171.      i.e.  `(TAG-SET . INSTANTIATOR)'.  A single, untagged instantiator
  172.      is given a tag set of `nil' (the empty set), and a single tag is
  173.      converted into a tag set consisting only of that tag.
  174.  
  175.      If NOERROR is non-`nil', signal an error if the inst-pair is
  176.      invalid; otherwise return `t'.
  177.  
  178.  - Function: canonicalize-inst-list INST-LIST SPECIFIER-TYPE &optional
  179.           NOERROR
  180.      This function canonicalizes the given INST-LIST (a list of
  181.      inst-pairs).
  182.  
  183.      SPECIFIER-TYPE specifies the type of specifier that this INST-LIST
  184.      will be used for.
  185.  
  186.      Canonicalizing means converting to the full form for an inst-list,
  187.      i.e.  `((TAG-SET . INSTANTIATOR) ...)'.  This function accepts a
  188.      single inst-pair or any abbreviation thereof or a list of
  189.      (possibly abbreviated) inst-pairs. (See `canonicalize-inst-pair'.)
  190.  
  191.      If NOERROR is non-`nil', signal an error if the inst-list is
  192.      invalid; otherwise return `t'.
  193.  
  194.  - Function: canonicalize-spec SPEC SPECIFIER-TYPE &optional NOERROR
  195.      This function canonicalizes the given SPEC (a specification).
  196.  
  197.      SPECIFIER-TYPE specifies the type of specifier that this SPEC-LIST
  198.      will be used for.
  199.  
  200.      Canonicalizing means converting to the full form for a spec, i.e.
  201.      `(LOCALE (TAG-SET . INSTANTIATOR) ...)'.  This function accepts a
  202.      possibly abbreviated inst-list or a cons of a locale and a
  203.      possibly abbreviated inst-list. (See `canonicalize-inst-list'.)
  204.  
  205.      If NOERROR is `nil', signal an error if the specification is
  206.      invalid; otherwise return `t'.
  207.  
  208.  - Function: canonicalize-spec-list SPEC-LIST SPECIFIER-TYPE &optional
  209.           NOERROR
  210.      This function canonicalizes the given SPEC-LIST (a list of
  211.      specifications).
  212.  
  213.      SPECIFIER-TYPE specifies the type of specifier that this SPEC-LIST
  214.      will be used for.
  215.  
  216.      Canonicalizing means converting to the full form for a spec-list,
  217.      i.e.  `((LOCALE (TAG-SET . INSTANTIATOR) ...) ...)'.  This
  218.      function accepts a possibly abbreviated specification or a list of
  219.      such things. (See `canonicalize-spec'.) This is the function used
  220.      to convert spec-lists accepted by `set-specifier' and such into a
  221.      form suitable for `add-spec-list-to-specifier'.
  222.  
  223.      This function tries extremely hard to resolve any ambiguities, and
  224.      the built-in specifier types (font, image, toolbar, etc.) are
  225.      designed so that there won't be any ambiguities.
  226.  
  227.      If NOERROR is `nil', signal an error if the spec-list is invalid;
  228.      otherwise return `t'.
  229.  
  230. 
  231. File: lispref.info,  Node: Retrieving Specifications,  Next: Specifier Tag Functions,  Prev: Adding Specifications,  Up: Specifiers
  232.  
  233. Retrieving the Specifications from a Specifier
  234. ==============================================
  235.  
  236.  - Function: specifier-spec-list SPECIFIER &optional LOCALE TAG-SET
  237.           EXACT-P
  238.      This function returns the spec-list of specifications for
  239.      SPECIFIER in LOCALE.
  240.  
  241.      If LOCALE is a particular locale (a buffer, window, frame, device,
  242.      or the symbol `global'), a spec-list consisting of the
  243.      specification for that locale will be returned.
  244.  
  245.      If LOCALE is a locale type (i.e. a symbol `buffer', `window',
  246.      `frame', or `device'), a spec-list of the specifications for all
  247.      locales of that type will be returned.
  248.  
  249.      If LOCALE is `nil' or the symbol `all', a spec-list of all
  250.      specifications in SPECIFIER will be returned.
  251.  
  252.      LOCALE can also be a list of locales, locale types, and/or `all';
  253.      the result is as if `specifier-spec-list' were called on each
  254.      element of the list and the results concatenated together.
  255.  
  256.      Only instantiators where TAG-SET (a list of zero or more tags) is
  257.      a subset of (or possibly equal to) the instantiator's tag set are
  258.      returned.  (The default value of` nil' is a subset of all tag sets,
  259.      so in this case no instantiators will be screened out.) If EXACT-P
  260.      is non-`nil', however, TAG-SET must be equal to an instantiator's
  261.      tag set for the instantiator to be returned.
  262.  
  263.  - Function: specifier-specs SPECIFIER &optional LOCALE TAG-SET EXACT-P
  264.      This function returns the specification(s) for SPECIFIER in LOCALE.
  265.  
  266.      If LOCALE is a single locale or is a list of one element
  267.      containing a single locale, then a "short form" of the
  268.      instantiators for that locale will be returned.  Otherwise, this
  269.      function is identical to `specifier-spec-list'.
  270.  
  271.      The "short form" is designed for readability and not for ease of
  272.      use in Lisp programs, and is as follows:
  273.  
  274.        1. If there is only one instantiator, then an inst-pair (i.e.
  275.           cons of tag and instantiator) will be returned; otherwise a
  276.           list of inst-pairs will be returned.
  277.  
  278.        2. For each inst-pair returned, if the instantiator's tag is
  279.           `any', the tag will be removed and the instantiator itself
  280.           will be returned instead of the inst-pair.
  281.  
  282.        3. If there is only one instantiator, its value is `nil', and
  283.           its tag is `any', a one-element list containing `nil' will be
  284.           returned rather than just `nil', to distinguish this case
  285.           from there being no instantiators at all.
  286.  
  287.  
  288.  - Function: specifier-fallback SPECIFIER
  289.      This function returns the fallback value for SPECIFIER.  Fallback
  290.      values are provided by the C code for certain built-in specifiers
  291.      to make sure that instancing won't fail even if all specs are
  292.      removed from the specifier, or to implement simple inheritance
  293.      behavior (e.g. this method is used to ensure that faces other than
  294.      `default' inherit their attributes from `default').  By design,
  295.      you cannot change the fallback value, and specifiers created with
  296.      `make-specifier' will never have a fallback (although a similar,
  297.      Lisp-accessible capability may be provided in the future to allow
  298.      for inheritance).
  299.  
  300.      The fallback value will be an inst-list that is instanced like any
  301.      other inst-list, a specifier of the same type as SPECIFIER
  302.      (results in inheritance), or `nil' for no fallback.
  303.  
  304.      When you instance a specifier, you can explicitly request that the
  305.      fallback not be consulted. (The C code does this, for example, when
  306.      merging faces.) See `specifier-instance'.
  307.  
  308. 
  309. File: lispref.info,  Node: Specifier Tag Functions,  Next: Specifier Instancing Functions,  Prev: Retrieving Specifications,  Up: Specifiers
  310.  
  311. Working With Specifier Tags
  312. ===========================
  313.  
  314.    A specifier tag set is an entity that is attached to an instantiator
  315. and can be used to restrict the scope of that instantiator to a
  316. particular device class or device type and/or to mark instantiators
  317. added by a particular package so that they can be later removed.
  318.  
  319.    A specifier tag set consists of a list of zero of more specifier
  320. tags, each of which is a symbol that is recognized by XEmacs as a tag.
  321. (The valid device types and device classes are always tags, as are any
  322. tags defined by `define-specifier-tag'.) It is called a "tag set" (as
  323. opposed to a list) because the order of the tags or the number of times
  324. a particular tag occurs does not matter.
  325.  
  326.    Each tag has a predicate associated with it, which specifies whether
  327. that tag applies to a particular device.  The tags which are device
  328. types and classes match devices of that type or class.  User-defined
  329. tags can have any predicate, or none (meaning that all devices match).
  330. When attempting to instance a specifier, a particular instantiator is
  331. only considered if the device of the domain being instanced over matches
  332. all tags in the tag set attached to that instantiator.
  333.  
  334.    Most of the time, a tag set is not specified, and the instantiator
  335. gets a null tag set, which matches all devices.
  336.  
  337.  - Function: valid-specifier-tag-p TAG
  338.      This function returns non-`nil' if TAG is a valid specifier tag.
  339.  
  340.  - Function: valid-specifier-tag-set-p TAG-SET
  341.      This function returns non-`nil' if TAG-SET is a valid specifier
  342.      tag set.
  343.  
  344.  - Function: canonicalize-tag-set TAG-SET
  345.      This function canonicalizes the given tag set.  Two canonicalized
  346.      tag sets can be compared with `equal' to see if they represent the
  347.      same tag set. (Specifically, canonicalizing involves sorting by
  348.      symbol name and removing duplicates.)
  349.  
  350.  - Function: device-matches-specifier-tag-set-p DEVICE TAG-SET
  351.      This function returns non-`nil' if DEVICE matches specifier tag
  352.      set TAG-SET.  This means that DEVICE matches each tag in the tag
  353.      set.
  354.  
  355.  - Function: define-specifier-tag TAG &optional PREDICATE
  356.      This function defines a new specifier tag.  If PREDICATE is
  357.      specified, it should be a function of one argument (a device) that
  358.      specifies whether the tag matches that particular device.  If
  359.      PREDICATE is omitted, the tag matches all devices.
  360.  
  361.      You can redefine an existing user-defined specifier tag.  However,
  362.      you cannot redefine the built-in specifier tags (the device types
  363.      and classes) or the symbols `nil', `t', `all', or `global'.
  364.  
  365.  - Function: device-matching-specifier-tag-list &optional DEVICE
  366.      This function returns a list of all specifier tags matching
  367.      DEVICE.  DEVICE defaults to the selected device if omitted.
  368.  
  369.  - Function: specifier-tag-list
  370.      This function returns a list of all currently-defined specifier
  371.      tags.  This includes the built-in ones (the device types and
  372.      classes).
  373.  
  374.  - Function: specifier-tag-predicate TAG
  375.      This function returns the predicate for the given specifier tag.
  376.  
  377. 
  378. File: lispref.info,  Node: Specifier Instancing Functions,  Next: Specifier Example,  Prev: Specifier Tag Functions,  Up: Specifiers
  379.  
  380. Functions for Instancing a Specifier
  381. ====================================
  382.  
  383.  - Function: specifier-instance SPECIFIER &optional DOMAIN DEFAULT
  384.           NO-FALLBACK
  385.      This function instantiates SPECIFIER (return its value) in DOMAIN.
  386.      If no instance can be generated for this domain, return DEFAULT.
  387.  
  388.      DOMAIN should be a window, frame, or device.  Other values that
  389.      are legal as a locale (e.g. a buffer) are not valid as a domain
  390.      because they do not provide enough information to identify a
  391.      particular device (see `valid-specifier-domain-p').  DOMAIN
  392.      defaults to the selected window if omitted.
  393.  
  394.      "Instantiating" a specifier in a particular domain means
  395.      determining the specifier's "value" in that domain.  This is
  396.      accomplished by searching through the specifications in the
  397.      specifier that correspond to all locales that can be derived from
  398.      the given domain, from specific to general.  In most cases, the
  399.      domain is an Emacs window.  In that case specifications are
  400.      searched for as follows:
  401.  
  402.        1. A specification whose locale is the window's buffer;
  403.  
  404.        2. A specification whose locale is the window itself;
  405.  
  406.        3. A specification whose locale is the window's frame;
  407.  
  408.        4. A specification whose locale is the window's frame's device;
  409.  
  410.        5. A specification whose locale is the symbol `global'.
  411.  
  412.      If all of those fail, then the C-code-provided fallback value for
  413.      this specifier is consulted (see `specifier-fallback').  If it is
  414.      an inst-list, then this function attempts to instantiate that list
  415.      just as when a specification is located in the first five steps
  416.      above.  If the fallback is a specifier, `specifier-instance' is
  417.      called recursively on this specifier and the return value used.
  418.      Note, however, that if the optional argument NO-FALLBACK is
  419.      non-`nil', the fallback value will not be consulted.
  420.  
  421.      Note that there may be more than one specification matching a
  422.      particular locale; all such specifications are considered before
  423.      looking for any specifications for more general locales.  Any
  424.      particular specification that is found may be rejected because it
  425.      is tagged to a particular device class (e.g. `color') or device
  426.      type (e.g. `x') or both and the device for the given domain does
  427.      not match this, or because the specification is not valid for the
  428.      device of the given domain (e.g.  the font or color name does not
  429.      exist for this particular X server).
  430.  
  431.      The returned value is dependent on the type of specifier.  For
  432.      example, for a font specifier (as returned by the `face-font'
  433.      function), the returned value will be a font-instance object.  For
  434.      images, the returned value will be a string, pixmap, or subwindow.
  435.  
  436.  - Function: specifier-instance-from-inst-list SPECIFIER DOMAIN
  437.           INST-LIST &optional DEFAULT
  438.      This function attempts to convert a particular inst-list into an
  439.      instance.  This attempts to instantiate INST-LIST in the given
  440.      DOMAIN, as if INST-LIST existed in a specification in SPECIFIER.
  441.      If the instantiation fails, DEFAULT is returned.  In most
  442.      circumstances, you should not use this function; use
  443.      `specifier-instance' instead.
  444.  
  445. 
  446. File: lispref.info,  Node: Specifier Example,  Next: Creating Specifiers,  Prev: Specifier Instancing Functions,  Up: Specifiers
  447.  
  448. Example of Specifier Usage
  449. ==========================
  450.  
  451.    Now let us present an example to clarify the theoretical discussions
  452. we have been through.  In this example, we will use the general
  453. specifier functions for clarity.  Keep in mind that many types of
  454. specifiers, and some other types of objects that are associated with
  455. specifiers (e.g. faces), provide convenience functions making it easier
  456. to work with objects of that type.
  457.  
  458.    Let us consider the background color of the default face.  A
  459. specifier is used to specify how that color will appear in different
  460. domains.  First, let's retrieve the specifier:
  461.  
  462.      (setq sp (face-property 'default 'background))
  463.          =>   #<color-specifier 0x3da>
  464.  
  465.      (specifier-specs sp)
  466.          =>   ((#<buffer "device.c"> (nil . "forest green"))
  467.                       (#<window on "Makefile" 0x8a2b> (nil . "hot pink"))
  468.                       (#<x-frame "emacs" 0x4ac> (nil . "puke orange")
  469.                             (nil . "moccasin"))
  470.                       (#<x-frame "VM" 0x4ac> (nil . "magenta"))
  471.               (global ((tty) . "cyan") (nil . "white"))
  472.                      )
  473.  
  474.    Then, say we want to determine what the background color of the
  475. default face is for the window currently displaying the buffer
  476. `*scratch*'.  We call
  477.  
  478.      (get-buffer-window "*scratch*")
  479.          => #<window on "*scratch*" 0x4ad>
  480.      (window-frame (get-buffer-window "*scratch*"))
  481.          => #<x-frame "emacs" 0x4ac>
  482.      (specifier-instance sp (get-buffer-window "*scratch*"))
  483.          => #<color-instance moccasin 47=(FFFF,E4E4,B5B5) 0x6309>
  484.  
  485.    Note that we passed a window to `specifier-instance', not a buffer.
  486. We cannot pass a buffer because a buffer by itself does not provide
  487. enough information.  The buffer might not be displayed anywhere at all,
  488. or could be displayed in many different frames on different devices.
  489.  
  490.    The result is arrived at like this:
  491.  
  492.   1. First, we look for a specification matching the buffer displayed
  493.      in the window, i.e. `*scratch'.  There are none, so we proceed.
  494.  
  495.   2. Then, we look for a specification matching the window itself.
  496.      Again, there are none.
  497.  
  498.   3. Then, we look for a specification matching the window's frame.  The
  499.      specification `(#<x-frame "emacs" 0x4ac> . "puke orange")' is
  500.      found.  We call the instantiation method for colors, passing it the
  501.      locale we were searching over (i.e. the window, in this case) and
  502.      the instantiator (`"puke orange"').  However, the particular device
  503.      which this window is on (let's say it's an X connection) doesn't
  504.      recognize the color `"puke orange"', so the specification is
  505.      rejected.
  506.  
  507.   4. So we continue looking for a specification matching the window's
  508.      frame.  We find `(#<x-frame "emacs" 0x4ac> . "moccasin")'.  Again,
  509.      we call the instantiation method for colors.  This time, the X
  510.      server our window is on recognizes the color `moccasin', and so the
  511.      instantiation method succeeds and returns a color instance.
  512.  
  513. 
  514. File: lispref.info,  Node: Creating Specifiers,  Next: Specifier Validation Functions,  Prev: Specifier Example,  Up: Specifiers
  515.  
  516. Creating New Specifier Objects
  517. ==============================
  518.  
  519.  - Function: make-specifier TYPE
  520.      This function creates a new specifier.
  521.  
  522.      A specifier is an object that can be used to keep track of a
  523.      property whose value can be per-buffer, per-window, per-frame, or
  524.      per-device, and can further be restricted to a particular
  525.      device-type or device-class.  Specifiers are used, for example,
  526.      for the various built-in properties of a face; this allows a face
  527.      to have different values in different frames, buffers, etc.  For
  528.      more information, see `specifier-instance', `specifier-specs', and
  529.      `add-spec-to-specifier'; or, for a detailed description of
  530.      specifiers, including how they are instantiated over a particular
  531.      domain (i.e. how their value in that domain is determined), see
  532.      the chapter on specifiers in the XEmacs Lisp Reference Manual.
  533.  
  534.      TYPE specifies the particular type of specifier, and should be one
  535.      of the symbols `generic', `integer', `natnum', `boolean', `color',
  536.      `font', `image', `face-boolean', or `toolbar'.
  537.  
  538.      For more information on particular types of specifiers, see the
  539.      functions `generic-specifier-p', `integer-specifier-p',
  540.      `natnum-specifier-p', `boolean-specifier-p', `color-specifier-p',
  541.      `font-specifier-p', `image-specifier-p',
  542.      `face-boolean-specifier-p', and `toolbar-specifier-p'.
  543.  
  544.  - Function: make-specifier-and-init TYPE SPEC-LIST &optional
  545.           DONT-CANONICALIZE
  546.      This function creates and initialize a new specifier.
  547.  
  548.      This is a front-end onto `make-specifier' that allows you to create
  549.      a specifier and add specs to it at the same time.  TYPE specifies
  550.      the specifier type.  SPEC-LIST supplies the specification(s) to be
  551.      added to the specifier. Normally, almost any reasonable
  552.      abbreviation of the full spec-list form is accepted, and is
  553.      converted to the full form; however, if optional argument
  554.      DONT-CANONICALIZE is non-`nil', this conversion is not performed,
  555.      and the SPEC-LIST must already be in full form.  See
  556.      `canonicalize-spec-list'.
  557.  
  558. 
  559. File: lispref.info,  Node: Specifier Validation Functions,  Next: Other Specification Functions,  Prev: Creating Specifiers,  Up: Specifiers
  560.  
  561. Functions for Checking the Validity of Specifier Components
  562. ===========================================================
  563.  
  564.  - Function: valid-specifier-domain-p DOMAIN
  565.      This function returns non-`nil' if DOMAIN is a valid specifier
  566.      domain.  A domain is used to instance a specifier (i.e. determine
  567.      the specifier's value in that domain).  Valid domains are a
  568.      window, frame, or device.  (`nil' is not valid.)
  569.  
  570.  - Function: valid-specifier-locale-p LOCALE
  571.      This function returns non-`nil' if LOCALE is a valid specifier
  572.      locale.  Valid locales are a device, a frame, a window, a buffer,
  573.      and `global'.  (`nil' is not valid.)
  574.  
  575.  - Function: valid-specifier-locale-type-p LOCALE-TYPE
  576.      Given a specifier LOCALE-TYPE, this function returns non-nil if it
  577.      is valid.  Valid locale types are the symbols `global', `device',
  578.      `frame', `window', and `buffer'. (Note, however, that in functions
  579.      that accept either a locale or a locale type, `global' is
  580.      considered an individual locale.)
  581.  
  582.  - Function: valid-specifier-type-p SPECIFIER-TYPE
  583.      Given a SPECIFIER-TYPE, this function returns non-`nil' if it is
  584.      valid.  Valid types are `generic', `integer', `boolean', `color',
  585.      `font', `image', `face-boolean', and `toolbar'.
  586.  
  587.  - Function: valid-specifier-tag-p TAG
  588.      This function returns non-`nil' if TAG is a valid specifier tag.
  589.  
  590.  - Function: valid-instantiator-p INSTANTIATOR SPECIFIER-TYPE
  591.      This function returns non-`nil' if INSTANTIATOR is valid for
  592.      SPECIFIER-TYPE.
  593.  
  594.  - Function: valid-inst-list-p INST-LIST TYPE
  595.      This function returns non-`nil' if INST-LIST is valid for
  596.      specifier type TYPE.
  597.  
  598.  - Function: valid-spec-list-p SPEC-LIST TYPE
  599.      This function returns non-`nil' if SPEC-LIST is valid for
  600.      specifier type TYPE.
  601.  
  602.  - Function: check-valid-instantiator INSTANTIATOR SPECIFIER-TYPE
  603.      This function signals an error if INSTANTIATOR is invalid for
  604.      SPECIFIER-TYPE.
  605.  
  606.  - Function: check-valid-inst-list INST-LIST TYPE
  607.      This function signals an error if INST-LIST is invalid for
  608.      specifier type TYPE.
  609.  
  610.  - Function: check-valid-spec-list SPEC-LIST TYPE
  611.      This function signals an error if SPEC-LIST is invalid for
  612.      specifier type TYPE.
  613.  
  614. 
  615. File: lispref.info,  Node: Other Specification Functions,  Prev: Specifier Validation Functions,  Up: Specifiers
  616.  
  617. Other Functions for Working with Specifications in a Specifier
  618. ==============================================================
  619.  
  620.  - Function: copy-specifier SPECIFIER &optional DEST LOCALE TAG-SET
  621.           EXACT-P HOW-TO-ADD
  622.      This function copies SPECIFIER to DEST, or creates a new one if
  623.      DEST is `nil'.
  624.  
  625.      If DEST is `nil' or omitted, a new specifier will be created and
  626.      the specifications copied into it.  Otherwise, the specifications
  627.      will be copied into the existing specifier in DEST.
  628.  
  629.      If LOCALE is `nil' or the symbol `all', all specifications will be
  630.      copied.  If LOCALE is a particular locale, the specification for
  631.      that particular locale will be copied.  If LOCALE is a locale
  632.      type, the specifications for all locales of that type will be
  633.      copied.  LOCALE can also be a list of locales, locale types,
  634.      and/or `all'; this is equivalent to calling `copy-specifier' for
  635.      each of the elements of the list.  See `specifier-spec-list' for
  636.      more information about LOCALE.
  637.  
  638.      Only instantiators where TAG-SET (a list of zero or more tags) is
  639.      a subset of (or possibly equal to) the instantiator's tag set are
  640.      copied.  (The default value of `nil' is a subset of all tag sets,
  641.      so in this case no instantiators will be screened out.) If EXACT-P
  642.      is non-`nil', however, TAG-SET must be equal to an instantiator's
  643.      tag set for the instantiator to be copied.
  644.  
  645.      Optional argument HOW-TO-ADD specifies what to do with existing
  646.      specifications in DEST.  If nil, then whichever locales or locale
  647.      types are copied will first be completely erased in DEST.
  648.      Otherwise, it is the same as in `add-spec-to-specifier'.
  649.  
  650.  - Function: remove-specifier SPECIFIER &optional LOCALE TAG-SET EXACT-P
  651.      This function removes specification(s) for SPECIFIER.
  652.  
  653.      If LOCALE is a particular locale (a buffer, window, frame, device,
  654.      or the symbol `global'), the specification for that locale will be
  655.      removed.
  656.  
  657.      If instead, LOCALE is a locale type (i.e. a symbol `buffer',
  658.      `window', `frame', or `device'), the specifications for all
  659.      locales of that type will be removed.
  660.  
  661.      If LOCALE is `nil' or the symbol `all', all specifications will be
  662.      removed.
  663.  
  664.      LOCALE can also be a list of locales, locale types, and/or `all';
  665.      this is equivalent to calling `remove-specifier' for each of the
  666.      elements in the list.
  667.  
  668.      Only instantiators where TAG-SET (a list of zero or more tags) is
  669.      a subset of (or possibly equal to) the instantiator's tag set are
  670.      removed.  (The default value of `nil' is a subset of all tag sets,
  671.      so in this case no instantiators will be screened out.) If EXACT-P
  672.      is non-`nil', however, TAG-SET must be equal to an instantiator's
  673.      tag set for the instantiator to be removed.
  674.  
  675.  - Function: map-specifier SPECIFIER FUNC &optional LOCALE MAPARG
  676.      This function applies FUNC to the specification(s) for LOCALE in
  677.      SPECIFIER.
  678.  
  679.      If LOCALE is a locale, FUNC will be called for that locale.  If
  680.      LOCALE is a locale type, FUNC will be mapped over all locales of
  681.      that type.  If LOCALE is `nil' or the symbol `all', FUNC will be
  682.      mapped over all locales in SPECIFIER.
  683.  
  684.      FUNC is called with four arguments: the SPECIFIER, the locale
  685.      being mapped over, the inst-list for that locale, and the optional
  686.      MAPARG.  If any invocation of FUNC returns non-`nil', the mapping
  687.      will stop and the returned value becomes the value returned from
  688.      `map-specifier'.  Otherwise, `map-specifier' returns `nil'.
  689.  
  690.  - Function: specifier-locale-type-from-locale LOCALE
  691.      Given a specifier LOCALE, this function returns its type.
  692.  
  693. 
  694. File: lispref.info,  Node: Faces and Window-System Objects,  Next: Glyphs,  Prev: Specifiers,  Up: Top
  695.  
  696. Faces and Window-System Objects
  697. *******************************
  698.  
  699. * Menu:
  700.  
  701. * Faces::        Controlling the way text looks.
  702. * Fonts::        Controlling the typeface of text.
  703. * Colors::        Controlling the color of text and pixmaps.
  704.  
  705. 
  706. File: lispref.info,  Node: Faces,  Next: Fonts,  Up: Faces and Window-System Objects
  707.  
  708. Faces
  709. =====
  710.  
  711.    A "face" is a named collection of graphical properties: font,
  712. foreground color, background color, background pixmap, optional
  713. underlining, and (on TTY devices) whether the text is to be highlighted,
  714. dimmed, blinking, or displayed in reverse video.  Faces control the
  715. display of text on the screen.  Every face has a name, which is a symbol
  716. such as `default' or `modeline'.
  717.  
  718.    Each built-in property of a face is controlled using a specifier,
  719. which allows it to have separate values in particular buffers, frames,
  720. windows, and devices and to further vary according to device type (X or
  721. TTY) and device class (color, mono, or grayscale).  *Note Specifiers::
  722. for more information.
  723.  
  724.    The face named `default' is used for ordinary text.  The face named
  725. `modeline' is used for displaying the modeline.  The face named
  726. `highlight' is used for highlighted extents (*note Extents::.).  The
  727. faces named `left-margin' and `right-margin' are used for the left and
  728. right margin areas, respectively (*note Annotations::.).  The face
  729. named `zmacs-region' is used for the highlighted region between point
  730. and mark.
  731.  
  732. * Menu:
  733.  
  734. * Merging Faces::        How XEmacs decides which face to use
  735.                   for a character.
  736. * Basic Face Functions::    How to define and examine faces.
  737. * Face Properties::        How to access and modify a face's properties.
  738. * Face Convenience Functions::    Convenience functions for accessing
  739.                   particular properties of a face.
  740. * Other Face Display Functions:: Other functions pertaining to how a
  741.                   a face appears.
  742.  
  743. 
  744. File: lispref.info,  Node: Merging Faces,  Next: Basic Face Functions,  Up: Faces
  745.  
  746. Merging Faces for Display
  747. -------------------------
  748.  
  749.    Here are all the ways to specify which face to use for display of
  750. text:
  751.  
  752.    * With defaults.  Each frame has a "default face", which is used for
  753.      all text that doesn't somehow specify another face.  The face named
  754.      `default' applies to the text area, while the faces `left-margin'
  755.      and `right-margin' apply to the left and right margin areas.
  756.  
  757.    * With text properties.  A character may have a `face' property; if
  758.      so, it's displayed with that face. (Text properties are actually
  759.      implemented in terms of extents.) *Note Text Properties::.
  760.  
  761.    * With extents.  An extent may have a `face' property, which applies
  762.      to all the text covered by the extent; in addition, if the
  763.      `highlight' property is set, the `highlight' property applies when
  764.      the mouse moves over the extent or if the extent is explicitly
  765.      highlighted.  *Note Extents::.
  766.  
  767.    * With annotations.  Annotations that are inserted into a buffer can
  768.      specify their own face. (Annotations are actually implemented in
  769.      terms of extents.)  *Note Annotations::.
  770.  
  771.    If these various sources together specify more than one face for a
  772. particular character, XEmacs merges the properties of the various faces
  773. specified.  Extents, text properties, and annotations all use the same
  774. underlying representation (as extents).  When multiple extents cover one
  775. character, an extent with higher priority overrides those with lower
  776. priority.  *Note Extents::.  If no extent covers a particular character,
  777. the `default' face is used.
  778.  
  779.    If a background pixmap is specified, it determines what will be
  780. displayed in the background of text characters.  If the background
  781. pixmap is actually a pixmap, with its colors specified, those colors are
  782. used; if it is a bitmap, the face's foreground and background colors are
  783. used to color it.
  784.  
  785. 
  786. File: lispref.info,  Node: Basic Face Functions,  Next: Face Properties,  Prev: Merging Faces,  Up: Faces
  787.  
  788. Basic Functions for Working with Faces
  789. --------------------------------------
  790.  
  791.    The properties a face can specify include the font, the foreground
  792. color, the background color, the background pixmap, the underlining,
  793. the display table, and (for TTY devices) whether the text is to be
  794. highlighted, dimmed, blinking, or displayed in reverse video.  The face
  795. can also leave these unspecified, causing them to assume the value of
  796. the corresponding property of the `default' face.
  797.  
  798.    Here are the basic primitives for working with faces.
  799.  
  800.  - Function: make-face NAME &optional DOC-STRING TEMPORARY
  801.      This function defines and returns a new face named NAME, initially
  802.      with all properties unspecified.  It does nothing if there is
  803.      already a face named NAME.  Optional argument DOC-STRING specifies
  804.      an explanatory string used for descriptive purposes.  If optional
  805.      argument TEMPORARY is non-`nil', the face will automatically
  806.      disappear when there are no more references to it anywhere in text
  807.      or Lisp code (otherwise, the face will continue to exist
  808.      indefinitely even if it is not used).
  809.  
  810.  - Function: face-list &optional TEMPORARY
  811.      This function returns a list of the names of all defined faces.  If
  812.      TEMPORARY is `nil', only the permanent faces are included.  If it
  813.      is `t', only the temporary faces are included.  If it is any other
  814.      non-`nil' value both permanent and temporary are included.
  815.  
  816.  - Function: facep OBJECT
  817.      This function returns whether the given object is a face.
  818.  
  819.  - Function: copy-face OLD-FACE NEW-NAME &optional LOCALE HOW-TO-ADD
  820.      This function defines a new face named NEW-NAME which is a copy of
  821.      the existing face named OLD-FACE.  If there is already a face
  822.      named NEW-NAME, then it alters the face to have the same
  823.      properties as OLD-FACE.  LOCALE and HOW-TO-ADD let you copy just
  824.      parts of the old face rather than the whole face, and are as in
  825.      `copy-specifier' (*note Specifiers::.).
  826.  
  827. 
  828. File: lispref.info,  Node: Face Properties,  Next: Face Convenience Functions,  Prev: Basic Face Functions,  Up: Faces
  829.  
  830. Face Properties
  831. ---------------
  832.  
  833.    You can examine and modify the properties of an existing face with
  834. the following functions.
  835.  
  836.    The following symbols have predefined meanings:
  837.  
  838. `foreground'
  839.      The foreground color of the face.
  840.  
  841. `background'
  842.      The background color of the face.
  843.  
  844. `font'
  845.      The font used to display text covered by this face.
  846.  
  847. `display-table'
  848.      The display table of the face.
  849.  
  850. `background-pixmap'
  851.      The pixmap displayed in the background of the face.  Only used by
  852.      faces on X devices.
  853.  
  854. `underline'
  855.      Underline all text covered by this face.
  856.  
  857. `highlight'
  858.      Highlight all text covered by this face.  Only used by faces on TTY
  859.      devices.
  860.  
  861. `dim'
  862.      Dim all text covered by this face.  Only used by faces on TTY
  863.      devices.
  864.  
  865. `blinking'
  866.      Blink all text covered by this face.  Only used by faces on TTY
  867.      devices.
  868.  
  869. `reverse'
  870.      Reverse the foreground and background colors.  Only used by faces
  871.      on TTY devices.
  872.  
  873. `doc-string'
  874.      Description of what the face's normal use is.  NOTE: This is not a
  875.      specifier, unlike all the other built-in properties, and cannot
  876.      contain locale-specific values.
  877.  
  878.  - Function: set-face-property FACE PROPERTY VALUE &optional LOCALE TAG
  879.           HOW-TO-ADD
  880.      This function changes a property of a FACE.
  881.  
  882.      For built-in properties, the actual value of the property is a
  883.      specifier and you cannot change this; but you can change the
  884.      specifications within the specifier, and that is what this
  885.      function will do.  For user-defined properties, you can use this
  886.      function to either change the actual value of the property or, if
  887.      this value is a specifier, change the specifications within it.
  888.  
  889.      If PROPERTY is a built-in property, the specifications to be added
  890.      to this property can be supplied in many different ways:
  891.  
  892.           If VALUE is a simple instantiator (e.g. a string naming a
  893.           font or color) or a list of instantiators, then the
  894.           instantiator(s) will be added as a specification of the
  895.           property for the given LOCALE (which defaults to `global' if
  896.           omitted).
  897.  
  898.           If VALUE is a list of specifications (each of which is a cons
  899.           of a locale and a list of instantiators), then LOCALE must be
  900.           `nil' (it does not make sense to explicitly specify a locale
  901.           in this case), and specifications will be added as given.
  902.  
  903.           If VALUE is a specifier (as would be returned by
  904.           `face-property' if no LOCALE argument is given), then some or
  905.           all of the specifications in the specifier will be added to
  906.           the property.  In this case, the function is really
  907.           equivalent to `copy-specifier' and LOCALE has the same
  908.           semantics (if it is a particular locale, the specification
  909.           for the locale will be copied; if a locale type,
  910.           specifications for all locales of that type will be copied;
  911.           if `nil' or `all', then all specifications will be copied).
  912.  
  913.      HOW-TO-ADD should be either `nil' or one of the symbols `prepend',
  914.      `append', `remove-tag-set-prepend', `remove-tag-set-append',
  915.      `remove-locale', `remove-locale-type', or `remove-all'.  See
  916.      `copy-specifier' and `add-spec-to-specifier' for a description of
  917.      what each of these means.  Most of the time, you do not need to
  918.      worry about this argument; the default behavior usually is fine.
  919.  
  920.      In general, it is OK to pass an instance object (e.g. as returned
  921.      by `face-property-instance') as an instantiator in place of an
  922.      actual instantiator.  In such a case, the instantiator used to
  923.      create that instance object will be used (for example, if you set
  924.      a font-instance object as the value of the `font' property, then
  925.      the font name used to create that object will be used instead).
  926.      If some cases, however, doing this conversion does not make sense,
  927.      and this will be noted in the documentation for particular types
  928.      of instance objects.
  929.  
  930.      If PROPERTY is not a built-in property, then this function will
  931.      simply set its value if LOCALE is `nil'.  However, if LOCALE is
  932.      given, then this function will attempt to add VALUE as the
  933.      instantiator for the given LOCALE, using `add-spec-to-specifier'.
  934.      If the value of the property is not a specifier, it will
  935.      automatically be converted into a `generic' specifier.
  936.  
  937.  - Function: face-property FACE PROPERTY &optional LOCALE
  938.      This function returns FACE's value of the given PROPERTY.
  939.  
  940.      If LOCALE is omitted, the FACE's actual value for PROPERTY will be
  941.      returned.  For built-in properties, this will be a specifier
  942.      object of a type appropriate to the property (e.g. a font or color
  943.      specifier).  For other properties, this could be anything.
  944.  
  945.      If LOCALE is supplied, then instead of returning the actual value,
  946.      the specification(s) for the given locale or locale type will be
  947.      returned.  This will only work if the actual value of PROPERTY is
  948.      a specifier (this will always be the case for built-in properties,
  949.      but not or not may apply to user-defined properties).  If the
  950.      actual value of PROPERTY is not a specifier, this value will
  951.      simply be returned regardless of LOCALE.
  952.  
  953.      The return value will be a list of instantiators (e.g. strings
  954.      specifying a font or color name), or a list of specifications,
  955.      each of which is a cons of a locale and a list of instantiators.
  956.      Specifically, if LOCALE is a particular locale (a buffer, window,
  957.      frame, device, or `global'), a list of instantiators for that
  958.      locale will be returned.  Otherwise, if LOCALE is a locale type
  959.      (one of the symbols `buffer', `window', `frame', or `device'), the
  960.      specifications for all locales of that type will be returned.
  961.      Finally, if LOCALE is `all', the specifications for all locales of
  962.      all types will be returned.
  963.  
  964.      The specifications in a specifier determine what the value of
  965.      PROPERTY will be in a particular "domain" or set of circumstances,
  966.      which is typically a particular Emacs window along with the buffer
  967.      it contains and the frame and device it lies within.  The value is
  968.      derived from the instantiator associated with the most specific
  969.      locale (in the order buffer, window, frame, device, and `global')
  970.      that matches the domain in question.  In other words, given a
  971.      domain (i.e. an Emacs window, usually), the specifier for PROPERTY
  972.      will first be searched for a specification whose locale is the
  973.      buffer contained within that window; then for a specification
  974.      whose locale is the window itself; then for a specification whose
  975.      locale is the frame that the window is contained within; etc.  The
  976.      first instantiator that is valid for the domain (usually this
  977.      means that the instantiator is recognized by the device [i.e. the
  978.      X server or TTY device] that the domain is on).  The function
  979.      `face-property-instance' actually does all this, and is used to
  980.      determine how to display the face.
  981.  
  982.  - Function: face-property-instance FACE PROPERTY &optional DOMAIN
  983.           DEFAULT NO-FALLBACK
  984.      This function returns the instance of FACE's PROPERTY in the
  985.      specified DOMAIN.
  986.  
  987.      Under most circumstances, DOMAIN will be a particular window, and
  988.      the returned instance describes how the specified property
  989.      actually is displayed for that window and the particular buffer in
  990.      it.  Note that this may not be the same as how the property
  991.      appears when the buffer is displayed in a different window or
  992.      frame, or how the property appears in the same window if you
  993.      switch to another buffer in that window; and in those cases, the
  994.      returned instance would be different.
  995.  
  996.      The returned instance will typically be a color-instance,
  997.      font-instance, or pixmap-instance object, and you can query it
  998.      using the appropriate object-specific functions.  For example, you
  999.      could use `color-instance-rgb-components' to find out the RGB
  1000.      (red, green, and blue) components of how the `background' property
  1001.      of the `highlight' face is displayed in a particular window.  The
  1002.      results might be different from the results you would get for
  1003.      another window (perhaps the user specified a different color for
  1004.      the frame that window is on; or perhaps the same color was
  1005.      specified but the window is on a different X server, and that X
  1006.      server has different RGB values for the color from this one).
  1007.  
  1008.      DOMAIN defaults to the selected window if omitted.
  1009.  
  1010.      DOMAIN can be a frame or device, instead of a window.  The value
  1011.      returned for a such a domain is used in special circumstances when
  1012.      a more specific domain does not apply; for example, a frame value
  1013.      might be used for coloring a toolbar, which is conceptually
  1014.      attached to a frame rather than a particular window.  The value is
  1015.      also useful in determining what the value would be for a
  1016.      particular window within the frame or device, if it is not
  1017.      overridden by a more specific specification.
  1018.  
  1019.      If PROPERTY does not name a built-in property, its value will
  1020.      simply be returned unless it is a specifier object, in which case
  1021.      it will be instanced using `specifier-instance'.
  1022.  
  1023.      Optional arguments DEFAULT and NO-FALLBACK are the same as in
  1024.      `specifier-instance'.  *Note Specifiers::.
  1025.  
  1026. 
  1027. File: lispref.info,  Node: Face Convenience Functions,  Next: Other Face Display Functions,  Prev: Face Properties,  Up: Faces
  1028.  
  1029. Face Convenience Functions
  1030. --------------------------
  1031.  
  1032.  - Function: set-face-foreground FACE COLOR &optional LOCALE TAG
  1033.           HOW-TO-ADD
  1034.  - Function: set-face-background FACE COLOR &optional LOCALE TAG
  1035.           HOW-TO-ADD
  1036.      These functions set the foreground (respectively, background)
  1037.      color of face FACE to COLOR.  The argument COLOR should be a
  1038.      string (the name of a color) or a color object as returned by
  1039.      `make-color' (*note Colors::.).
  1040.  
  1041.  - Function: set-face-background-pixmap FACE PIXMAP &optional LOCALE
  1042.           TAG HOW-TO-ADD
  1043.      This function sets the background pixmap of face FACE to PIXMAP.
  1044.      The argument PIXMAP should be a string (the name of a bitmap or
  1045.      pixmap file; the directories listed in the variable
  1046.      `x-bitmap-file-path' will be searched) or a glyph object as
  1047.      returned by `make-glyph' (*note Glyphs::.).  The argument may also
  1048.      be a list of the form `(WIDTH HEIGHT DATA)' where WIDTH and HEIGHT
  1049.      are the size in pixels, and DATA is a string, containing the raw
  1050.      bits of the bitmap.
  1051.  
  1052.  - Function: set-face-font FACE FONT &optional LOCALE TAG HOW-TO-ADD
  1053.      This function sets the font of face FACE.  The argument FONT
  1054.      should be a string or a font object as returned by `make-font'
  1055.      (*note Fonts::.).
  1056.  
  1057.  - Function: set-face-underline-p FACE UNDERLINE-P &optional LOCALE TAG
  1058.           HOW-TO-ADD
  1059.      This function sets the underline property of face FACE.
  1060.  
  1061.  - Function: face-foreground FACE &optional LOCALE
  1062.  - Function: face-background FACE &optional LOCALE
  1063.      These functions return the foreground (respectively, background)
  1064.      color specifier of face FACE.  *Note Colors::.
  1065.  
  1066.  - Function: face-background-pixmap FACE &optional LOCALE
  1067.      This function return the background-pixmap glyph object of face
  1068.      FACE.
  1069.  
  1070.  - Function: face-font FACE &optional LOCALE
  1071.      This function returns the font specifier of face FACE.  (Note:
  1072.      This is not the same as the function `face-font' in FSF Emacs.)
  1073.      *Note Fonts::.
  1074.  
  1075.  - Function: face-font-name FACE &optional DOMAIN
  1076.      This function returns the name of the font of face FACE, or `nil'
  1077.      if it is unspecified.  This is basically equivalent to `(font-name
  1078.      (face-font FACE) DOMAIN)' except that it does not cause an error
  1079.      if FACE's font is `nil'. (This function is named `face-font' in
  1080.      FSF Emacs.)
  1081.  
  1082.  - Function: face-underline-p FACE &optional LOCALE
  1083.      This function returns the underline property of face FACE.
  1084.  
  1085.  - Function: face-foreground-instance FACE &optional DOMAIN
  1086.  - Function: face-background-instance FACE &optional DOMAIN
  1087.      These functions return the foreground (respectively, background)
  1088.      color specifier of face FACE.  *Note Colors::.
  1089.  
  1090.  - Function: face-background-pixmap-instance FACE &optional DOMAIN
  1091.      This function return the background-pixmap glyph object of face
  1092.      FACE.
  1093.  
  1094.  - Function: face-font-instance FACE &optional DOMAIN
  1095.      This function returns the font specifier of face FACE.  *Note
  1096.      Fonts::.
  1097.  
  1098. 
  1099. File: lispref.info,  Node: Other Face Display Functions,  Prev: Face Convenience Functions,  Up: Faces
  1100.  
  1101. Other Face Display Functions
  1102. ----------------------------
  1103.  
  1104.  - Function: invert-face FACE &optional LOCALE
  1105.      Swap the foreground and background colors of face FACE.  If the
  1106.      face doesn't specify both foreground and background, then its
  1107.      foreground and background are set to the default background and
  1108.      foreground.
  1109.  
  1110.  - Function: face-equal FACE1 FACE2 &optional DOMAIN
  1111.      This returns `t' if the faces FACE1 and FACE2 will display in the
  1112.      same way.  DOMAIN is as in `face-property-instance'.
  1113.  
  1114.  - Function: face-differs-from-default-p FACE &optional DOMAIN
  1115.      This returns `t' if the face FACE displays differently from the
  1116.      default face.  DOMAIN is as in `face-property-instance'.
  1117.  
  1118.